import matplotlib.pyplot as plt
import pandas as pd
df=pd.read_excel('12138.xlsx', sheet_name='Sheet1',index_col=0)
plt.rcParams['font.sans-serif']='SimHei'
x=df['总分']
plt.xlabel('总分')
plt.ylabel('序号')
plt.title('成绩分布直方图')
plt.hist(x,bins=12,color=(0.894,0,0.498),edgecolor='k')
plt.show()